<?php defined('BASEPATH') or exit('No direct script access allowed.'); ?><?php defined('BASEPATH') or exit('No permission resources.'); ?>
<form class="form-horizontal" role="form" id="validateform" name="validateform" action="<?php echo base_url('adminpanel/files/edit')?>" >
	<div class='panel panel-default '>
		<div class='panel-heading'>
			<i class='fa fa-table'></i> 文件管理 修改信息
			<div class='panel-tools'>
				<div class='btn-group'>
					<a class="btn " href="<?php echo base_url('adminpanel/files')?>"><span class="glyphicon glyphicon-arrow-left"></span> 返回 </a>
				</div>
			</div>
		</div>
		<div class='panel-body '>
								<fieldset>
						<legend>基本信息</legend>
													
	<div class="form-group">
				<label for="title" class="col-sm-2 control-label form-control-static">文件名称</label>
				<div class="col-sm-9 ">
					<input type="text" name="title"  id="title"  value='<?php echo isset($data_info['title'])?$data_info['title']:'' ?>'  class="form-control validate[required]"  placeholder="请输入文件名称" >
				</div>
			</div>
													
	<div class="form-group">
				<label for="url" class="col-sm-2 control-label form-control-static">文件路径</label>
				<div class="col-sm-9 ">
					<a id="url_a"  ><img  width="100" id="url_SRC" border="1" src="<?php echo SITE_URL?><?php echo (isset($data_info["url"]) && $data_info["url"] != "nopic.gif")?"uploadfile/files/".$data_info["url"]:"images/nopic.gif" ?>"/></a>
<input type="hidden" id="url" name="url" value="<?php echo isset($data_info["url"])?$data_info["url"]:"" ?>" /> <a id="url_b" class="btn btn-default btn-sm" > 选择图片 ...</a><span class="help-block">只支持图片上传.</span>
				</div>
			</div>
																																																				
	<div class="form-group">
				<label for="sort" class="col-sm-2 control-label form-control-static">排序</label>
				<div class="col-sm-9 ">
					<input type="number" name="sort"  id="sort"  value='<?php echo isset($data_info['sort'])?$data_info['sort']:'' ?>'   class="form-control  validate[required,custom[integer]]" placeholder="请输入排序" >
				</div>
			</div>
													
	<div class="form-group">
				<label for="files_type_id" class="col-sm-2 control-label form-control-static">类别ID</label>
				<div class="col-sm-9 ">
					<?php $options = process_datasource($this->method_config['filestype_choose_datasource'])?>
					<select class="form-control  validate[required]"  name="files_type_id"  id="files_type_id">
						<option value="">==请选择==</option>
<?php if($options)foreach($options as $option):?>
						<option value='<?php echo $option['val'];?>' <?php if(isset($data_info['files_type_id'])&&($data_info['files_type_id']==$option['val'])) { ?> selected="selected" <?php } ?>            ><?php echo $option['text'];?></option>
<?php endforeach;?>
					</select>

				</div>
			</div>
											</fieldset>
									<fieldset>
						<legend>附加信息</legend>
													
	<div class="form-group">
				<label for="notes" class="col-sm-2 control-label form-control-static">备注信息</label>
				<div class="col-sm-9 ">
					<textarea name="notes"  id="notes"  cols="45" rows="5" class="form-control " placeholder="请输入备注信息" ><?php echo isset($data_info['notes'])?$data_info['notes']:'' ?></textarea>
				</div>
			</div>
											</fieldset>
							<div class='form-actions'>
				<button class='btn btn-primary ' type='submit' id="dosubmit">保存</button>
			</div>
</form>
			<script language="javascript" type="text/javascript">
			var is_edit =<?php echo ($is_edit)?"true":"false" ?>;
			var id =<?php echo $id;?>;

			require(['<?php echo SITE_URL?>scripts/common.js'], function (common) {
		        require(['<?php echo SITE_URL?>scripts/adminpanel/files/edit.js']);
		    });
		</script>
	
	